package com.github.sbb.sherry.primitives.api;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;

public class Facts implements Iterable<Fact> {

  private final List<Fact> values = new ArrayList<>();

  public void add(Fact fact) {
    Objects.requireNonNull(fact, "fact must not be null");
    values.add(fact);
  }

  public int size() {
    return values.size();
  }

  public Fact get(int index) {
    return values.get(index);
  }

  public List<Fact> asList() {
    return values;
  }

  @Override
  public Iterator<Fact> iterator() {
    return values.iterator();
  }
}
